/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmProjectSegmentation extends BasicModel<PmProjectSegmentation> {
  createDate?: string; // 申请时间
  name?: string; // 分单名称
  oldid?: string; // 选中的工程编号
  childid?: string; // 生成新项目的ID
  reasonid?: string; // 分单原因类型
  remarks?: string; // 分单原因
  createBy?: string; // 编码
  ischeck?: number; // 是否审核
  isspinoff?: string; // 分单结果
  newpjno?: string; // 拆分后单号
  msg?: string; // 审批意见
  ddate?: string; // 审核时间
  dfile?: string; // dfile
  fdType?: string; // 分单类型
  errorcontent?: string; // 错误信息
  pmProjectSplitNatureList?: any[]; // 子表列表
}

export const pmProjectSegmentationList = (params?: PmProjectSegmentation | any) =>
  defHttp.get<PmProjectSegmentation>({
    url: adminPath + '/process/fd/pmProjectSegmentation/list',
    params,
  });

export const pmProjectSegmentationListData = (params?: PmProjectSegmentation | any) =>
  defHttp.post<Page<PmProjectSegmentation>>({
    url: adminPath + '/process/fd/pmProjectSegmentation/listData',
    params,
  });

export const pmProjectSegmentationForm = (params?: PmProjectSegmentation | any) =>
  defHttp.get<PmProjectSegmentation>({
    url: adminPath + '/process/fd/pmProjectSegmentation/form',
    params,
  });

export const pmProjectSegmentationSave = (params?: any, data?: PmProjectSegmentation | any) =>
  defHttp.postJson<PmProjectSegmentation>({
    url: adminPath + '/process/fd/pmProjectSegmentation/save',
    params,
    data,
  });

export const pmProjectSegmentationDelete = (params?: PmProjectSegmentation | any) =>
  defHttp.get<PmProjectSegmentation>({
    url: adminPath + '/process/fd/pmProjectSegmentation/delete',
    params,
  });

export const queryMeterListBwData = (params?: PmProjectSegmentation | any) =>
  defHttp.post<Page<PmProjectSegmentation>>({
    url: adminPath + '/process/fd/pmProjectSegmentation/QueryMeterListBwData',
    params,
  });